
# -*- coding: utf-8 -*-

from django.forms import ModelForm, ModelChoiceField,ModelMultipleChoiceField
from wal.familias.models import Familia


class choiceName(ModelChoiceField):
    def label_from_instance(self, obj):
        name = obj.first_name +' '+ obj.last_name
        return name
    
class choiceMultipleName(ModelMultipleChoiceField):
    def label_from_instance(self, obj):
        name = obj.first_name +' '+ obj.last_name
        return name
    
class FamiliasForm(ModelForm):
    class Meta:
        model = Familia